/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pacificlms.Verifiable.Database;

import pacificlms.Verifiable.*;

/**
 *
 * @author Brian Hume
 */
public class Setting extends VerifiableObject {
    //fixme from db
    public Setting(){}
    public Setting(String Name, String Type, String Value)
    {
        this.Name = Name;
        this.Type = Type;
        this.Value = Value;
    }
    
    @Override
    public String TableName() {
        return "Setting";
    }
    
    
    private String SettingID;
    @VerifyAnnotation(ApplicationName="SettingID", DBName="SettingID",  Type=TypeEnum.NUMERICSTRING, Length=11, PrimaryKey=true)
    public String SettingID(String value)
    {
        return SettingID = StandardProcess(SettingID, value);
    }
    
    
    private String Name;
    @VerifyAnnotation(ApplicationName="Name", DBName="Name",  Type=TypeEnum.STRING, Length=100)
    public String Name(String value)
    {
        return Name = StandardProcess(Name, value);
    }
    
    
    private String  Type;
    @VerifyAnnotation(ApplicationName="Type", DBName="Type",  Type=TypeEnum.ENUM, Length=20, EnumList={"NUMBER", "WORD", "TEXT"})
    public String Type(String value)
    {
        return Type = StandardProcess(Type, value);
    }
    
    
    private String Value;
    @VerifyAnnotation(ApplicationName="Value", DBName="Value",  Type=TypeEnum.STRING, Length=2000)
    public String Value(String value)
    {
        return Value = StandardProcess(Value, value);
    }
    
    
    //Do not need to worry about verification since CheckOutRule are not be saved by the program
    @Override
    protected boolean ExtraVerification()
    {
        return true;
    }
    
    
    @Override
    public String toString()
    {
        return Name + "=" + "[" + Value + "]";
    }
}